<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .bg-img {
            background: url(../image/001.jpg);
            height: 100vh;
            background-size: cover;
            background-position: center;
        }

        .bg-img::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            background: rgba(0, 0, 0, .7);
        }

        .content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            z-index: 999;
            text-align: center;
            width: 370px;
            padding: 60px 32px;
            background: rgba(255, 255, 255, .04);
            box-shadow: -1px 4px 28px 0px rgba(0, 0, 0, .75);
        }

        .content header {
            color: white;
            font-size: 33px;
            font-weight: 600;
            margin: 0 0 35px 0;
            font-family: 'Montserrat', sans-serif;
        }

        .field {
            position: relative;
            height: 45px;
            width: 100%;
            display: flex;
            background: rgba(255, 255, 255, .94);
        }

        .field span {
            color: #222;
            width: 40px;
            line-height: 45px;
        }

        .field input {
            height: 100%;
            width: 100%;
            background: transparent;
            border: none;
            outline: none;
            color: #222;
            font-size: 16px;
            font-family: 'Poppins', sans-serif;
        }

        .space {
            margin-top: 16px;
        }

        .pass {
            text-align: left;
            margin: 10px 0;
        }

        .pass a {
            color: white;
            font-family: 'Poppins', sans-serif;
            text-decoration: none;
        }

        .pass:hover a {
            text-decoration: underline;
        }

        input[type="submit"] {
            background: #3498db;
            border: 1px solid #2691d9;
            color: white;
            font-size: 18px;
            letter-spacing: 1px;
            font-weight: 600;
            cursor: pointer;
            font-family: 'Montserrat', sans-serif;
        }

        input[type="submit"] :hover {
            background: #2691d9;
        }

        .login {
            color: white;
            margin: 20px 0;
            font-weight: 700;
        }

        .link {
            display: flex;
            cursor: pointer;
            color: white;
            margin: 0 0 20px 0;
        }

        .facebook,
        .trash {
            width: 100%;
            height: 45px;
            line-height: 45px;
            margin-top: 10px;
            margin-left: 10px;
        }

        .facebook {
            margin-left: 0px;
            background: #4267b2;
            border: 1px solid #3e61a8;
        }

        .trash {
            background: #e1306c;
            border: 1px solid #df2060;
        }

        .link i {
            font-size: 17px;
        }

        .link span {
            font-size: 16px;
            margin-left: 8px;
            letter-spacing: 1px;
            font-weight: 600;
            font-family: 'Poppins', sans-serif;
        }

        .signup {
            color: white;
            font-size: 15px;
            font-family: 'Poppins', sans-serif;
        }

        .signup a {
            color: #3498db;
            text-decoration: none;
        }

        .signup a:hover {
            text-decoration: underline;
        }

        .show {
            position: absolute;
            right: 13px;
            font-size: 13px;
            font-weight: 700;
            color: #222;
            cursor: pointer;
            display: none;
            font-family: 'Montserrat', sans-serif;
        }

        /* 文本框输入后显示 */
        .password:valid~.show {
            display: block;
        }
    </style>
</head>

<body>
    <div class="bg-img">
        <div class="content">
            <header>Login Form</header>
            <form action="#">
                <div class="field">
                    <span class="fa fa-user"></span>
                    <!-- required空白提交弹窗 -->
                    <input type="text" required placeholder="Email or Phone">
                </div>
                <div class="field space">
                    <span class="fa fa-lock"></span>
                    <input type="password" class="password" required placeholder="Password">
                    <span class="show">SHOW</span>
                </div>
                <div class="pass">
                    <a href="#">Forgot Password</a>
                </div>
                <div class="field">
                    <input type="submit" value="LOGIN">
                </div>
                <div class="login">Or login with</div>
                <div class="link">
                    <div class="facebook">
                        <i class="fa fa-facebook"><span>Facebook</span></i>
                    </div>
                    <div class="trash">
                        <i class="fa fa-trash"><span>Trash</span></i>
                    </div>
                </div>
                <div class="signup">Don't have account?
                    <a href="#">Signup Now</a>
                </div>
            </form>
        </div>
    </div>
</body>
<script>
    const pass_field = document.querySelector('.password');
    const show_btn = document.querySelector('.show');
    show_btn.addEventListener('click', function () {
        if (pass_field.type === "password") {
            pass_field.type = "text";
            show_btn.style.color = "#3498db";
            show_btn.textContent = "HIDE";
        } else {
            pass_field.type = "password";
            show_btn.style.color = "#222";
            show_btn.textContent = "SHOW";
        }
    });
</script>

</html>